]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: Calculate the window slots when we reposition
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 26 Feb 2013 03:41:40 +0000 (22:41 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 22 Apr 2013 18:01:00 +0000 (14:01 -0400)
Repositioning will eventually be separated from recalculation
to accomodate two different geometries, so we'll need to do
the padding and area manipulation in two different areas.

https://bugzilla.gnome.org/show_bug.cgi?id=694469

js/ui/workspace.js

index d0d989ee81deef872bf4da0a30f55f7806c36124..af0fdfe36f750c74934991f8da9f39f46798abc0 100644 (file)
@@ -1039,8 +1039,12 @@ const Workspace = new Lang.Class({
         let initialPositioning = flags & WindowPositionFlags.INITIAL;
         let animate = flags & WindowPositionFlags.ANIMATE;
 
-        // Start the animations
-        let slots = this._computeAllWindowSlots(clones);
+        let layout = this._computeLayout(clones);
+        let strategy = layout.strategy;
+
+        let [, , padding] = this._getSpacingAndPadding();
+        let area = padArea(this._fullGeometry, padding);
+        let slots = strategy.computeWindowSlots(layout, area);
 
         let currentWorkspace = global.screen.get_active_workspace();
         let isOnCurrentWorkspace = this.metaWorkspace == null || this.metaWorkspace == currentWorkspace;
@@ -1484,7 +1488,7 @@ const Workspace = new Lang.Class({
         }
     },
 
-    _computeLayout: function(windows, area, rowSpacing, columnSpacing) {
+    _getBestLayout: function(windows, area, rowSpacing, columnSpacing) {
         // We look for the largest scale that allows us to fit the
         // largest row/tallest column on the workspace.
 
@@ -1546,11 +1550,10 @@ const Workspace = new Lang.Class({
         return [rowSpacing, columnSpacing, padding];
     },
 
-    _computeAllWindowSlots: function(windows) {
+    _computeLayout: function(windows) {
         let [rowSpacing, columnSpacing, padding] = this._getSpacingAndPadding();
         let area = padArea(this._fullGeometry, padding);
-        let layout = this._computeLayout(windows, area, rowSpacing, columnSpacing);
-        return layout.strategy.computeWindowSlots(layout, area);
+        return this._getBestLayout(windows, area, rowSpacing, columnSpacing);
     },
 
     _onCloneSelected : function (clone, time) {